<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ include file="/includes/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/common.css" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
	var type = '${type}';
	if(type=='add'){
		alert("添加班级成功!");
	}
	function selDepartment(){
	var id = $("#instituteId").val();
	var action = "listDepartmentJson.action?institute.id="+id;
	$.getJSON(action,function(data){
		var json = eval(data);
		$.each(json,function(i,n){
			$("#departmentId").append('<option value='+json[i].id+'>'+json[i].name+'</option>');
		})
	})
	}
	
</script>
</head>
	<body>
		<div id="man_zone">
		<form action="saveClazz.action" method="post" id="form1" >
		 <!-- 
			<input type="hidden"  name="user.id" value="${user.id}"/>
			<input type="hidden"  name="user.version" value="${user.version}"/>
		  -->
		 <table class="table_style" border="0" align="center"  cellpadding="3" cellspacing="1" width="800px">
		   	<tr>
		   		
		   		<td class="left_title_1">班级名:</td>
		   		<td>
		   		<input type="text" id="clazz.name" name="clazz.name" value="${clazz.name}"/>
		   		<s:if test="hasFieldErrors() && fieldErrors.get('clazz.name') != null">
					<s:fielderror><s:param>clazz.name</s:param></s:fielderror>
				</s:if>
		   		</td>
		   		<td class="left_title_1">班级编号:</td>
		   		<td>
		   		<input type="text" id="clazz.code" name="clazz.code" value="${clazz.code}"/>
		   		<s:if test="hasFieldErrors() && fieldErrors.get('clazz.code') != null">
					<s:fielderror><s:param>clazz.code</s:param></s:fielderror>
				</s:if>
				<s:actionerror/>
		   		</td>	
		   		<td class="left_title_1">所属学院:</td>
		   		<td>
		   			<select  id="instituteId" onchange="selDepartment();">
		   				<option>---请选择学院---</option>
		   				<s:iterator value="institutes">
		   					<option value="${id}">${name}</option>
		   				</s:iterator>
		   			</select>
		   		</td>	
		   		<td class="left_title_1">所属专业:</td>
		   		<td>
		   			<select id="departmentId" name="department.id"">
						<option>---请选择专业---</option>
					   </select>
		   		</td>	
		   		
		   	</tr>
		 
		  </table>
		<table class="table_style" border="0" align="center"  cellpadding="3" cellspacing="0">
	       	<tr>
	         <td>
	          <input type="submit" value="提交" />
	          <span class="sub_sp">&nbsp;</span>
	          <s:reset value="重置"/>  
	         </td>
	       </tr>
		</table>
		</form>
		</div>
	</body>
</html>